package com.toby.ioc.beanlifecycle;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

/**
 * @desc: bean生命周期2 通过实现2个接口
 * @author: jonathan.zhang
 * @date: 2019/7/13 1:30
 */
@Component
public class LifeCycleBean2 implements InitializingBean, DisposableBean {

    public LifeCycleBean2(){
        System.out.println("LifeCycleBean2 Constructor");
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("LifeCycleBean2 destroy");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("LifeCycleBean2 afterPropertiesSet");
    }
}
